package org.edu.modules.classChoise.service.impl;

import org.edu.modules.classChoise.entity.VeJwXkmskc;
import org.edu.modules.classChoise.mapper.VeJwXkmskcMapper;
import org.edu.modules.classChoise.service.IVeJwXkmskcService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @Description: 选课模式课程明细
 * @Author:
 * @Date:   2021-05-14
 * @Version: V1.0
 */
@Service
public class VeJwXkmskcServiceImpl extends ServiceImpl<VeJwXkmskcMapper, VeJwXkmskc> implements IVeJwXkmskcService {
    @Autowired
    VeJwXkmskcMapper veJwXkmskcMapper;

    @Override
    @Transactional
    public boolean saveBatchByMsId(List<VeJwXkmskc> veJwXkmskcList) {

        Integer msId = veJwXkmskcList.get(0).getMsid();
        try {
            veJwXkmskcMapper.deleteByMsid(msId);
            this.saveBatch(veJwXkmskcList);
            return true;
        }
        catch (Exception ex){
            return false;
        }
    }
}
